#include "Animator.h"
#include "Transform.h"
#include "Time.h"
#include <cmath>

namespace DYEngine
{
	Animator::Animator() : Component(), mSkinnedMesh(nullptr), mAnimData(nullptr), mTime(0), mIsPlaying(false) { }

	Animator::~Animator() { }

	void Animator::Play()
	{

	}

	void Animator::Init()
	{

	}

	void Animator::Enable()
	{

	}

	void Animator::Update()
	{
		//if (!mIsPlaying) return;

		mTime += Time::GetDeltaTime();
		AnimationFrame* frames = mAnimData->Evaluate(mTime, true);
		mSkinnedMesh->Animation(frames);
	}

	void Animator::Disable()
	{

	}

	void Animator::Destroy()
	{

	}
}